//
//  ZZContactUsView.m
//  ZuZuBao
//
//  Created by Felix on 2024/4/15.
//

#import "ZZContactUsView.h"

@implementation ZZContactUsView

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        UIView * backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
        backView.backgroundColor = kRGBAColor(0x000000, 0.6);
        [self addSubview:backView];
        
        UIView * wView = [[UIView alloc] initWithFrame:CGRectMake(43, kScreenHeight / 2 - 83, kScreenWidth - 86, 166)];
        wView.backgroundColor = [UIColor whiteColor];
        wView.layer.cornerRadius = 12;
        wView.layer.masksToBounds = YES;
        [self addSubview:wView];
        
        UILabel * cLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 29, wView.frame.size.width, 18)];
        cLabel.textColor = k333Color;
        cLabel.font = [UIFont systemFontOfSize:16];
        cLabel.textAlignment = NSTextAlignmentCenter;
        cLabel.text = @"联系我们";
        [wView addSubview:cLabel];
        
        self.phoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(cLabel.frame) + 16, wView.frame.size.width, 18)];
        self.phoneLabel.textColor = k666Color;
        self.phoneLabel.font = [UIFont systemFontOfSize:16];
        self.phoneLabel.textAlignment = NSTextAlignmentCenter;
        [wView addSubview:self.phoneLabel];
        
        UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake(50, CGRectGetMaxY(self.phoneLabel.frame) + 26, wView.frame.size.width - 100, 42);
        button.backgroundColor = kRGBAColor(0xECECEC, 1);
        button.layer.cornerRadius = 21;
        button.layer.masksToBounds = YES;
        [button setTitleColor:k333Color forState:UIControlStateNormal];
        [button setTitle:@"知道了" forState:UIControlStateNormal];
        button.titleLabel.font = [UIFont systemFontOfSize:16];
        [button addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside];
        [wView addSubview:button];
    }
    return self;
}

- (void)confirmAction {
    [self removeFromSuperview];
}

@end
